Skip to content

Print the full anyhow context chain in error messages - #12882

Merged
rerun-sync[bot] merged 1 commit into
rerun-io:mainfrom
MsfPablo:fix-anyhow-context-truncation
Aug 12, 2026
Merged

Print the full anyhow context chain in error messages#12882
rerun-sync[bot] merged 1 commit into
rerun-io:mainfrom
MsfPablo:fix-anyhow-context-truncation

Conversation

@MsfPablo

@MsfPablo MsfPablo commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What

anyhow::Error's Display impl only prints the outermost context, so the root cause is silently dropped (#8681). The alternate format, {:#}, walks the whole chain instead.

This fixes the places where an anyhow::Error was being flattened:

  • re_mcap::Error::InvalidSchema{source}{source:#}
  • re_mcap::Error::Other#[error(transparent)]#[error("{0:#}")]
  • re_mcap::parsers::cdr::CdrError::Other{0}{0:#}
  • re_parquet::ParquetError::Other#[error(transparent)]#[error("{0:#}")]
  • re_server's Error::RrdLoadingError{0}{0:#}
  • the top-level AddrInUse warning in entrypoint.rs

This matches the pattern already used elsewhere in the codebase (ChunkStoreError::VideoRebatch uses {0:#}, and re_query/re_importer/re_lerobot use re_error::format).

The #[from] attribute still designates the field as the error source(), so replacing transparent with an explicit format string does not break source chaining.

Part of #8681.

`anyhow::Error`'s `Display` only prints the outermost context, hiding the
root cause. Use the alternate format (`{:#}`), which walks the whole chain,
in the places where an `anyhow::Error` was being flattened.

Fixes part of rerun-io#8681

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for opening this pull request.

Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.

@emilk
emilk requested a review from grtlr August 11, 2026 09:36

@grtlr grtlr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thank you!

There might be a problem with error's becoming too long now, but I think that requires more internal fixes, so this should be good for now.

@grtlr grtlr added 🪳 bug Something isn't working exclude from changelog PRs with this won't show up in CHANGELOG.md labels Aug 12, 2026
@grtlr

grtlr commented Aug 12, 2026

Copy link
Copy Markdown
Member

@rerun-bot sync-reality

@rerun-sync

rerun-sync Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Sync complete. Mirror PR in reality: https://github.com/rerun-io/reality/pull/3119

Triggered by @grtlr

@rerun-sync
rerun-sync Bot merged commit f8cd770 into rerun-io:main Aug 12, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪳 bug Something isn't working exclude from changelog PRs with this won't show up in CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants